#ifndef _ZERO_ORB_EXECUTEBODY_H
#define _ZERO_ORB_EXECUTEBODY_H
#include "include/lib.h"

namespace zero
{
class ExecuteBody
{
	public:
		static ExecuteBody* current() {
			unsigned int tmp;
			asm volatile ( "movl %%ebp, %0\n\t" : "=q" (tmp) : );
			return reinterpret_cast<ExecuteBody*>(tmp & ~0xfff);
		}

		__extension__ enum {
			LOW = 1,
			DEFAULT,
			HIGH,
		} priority;
		List item;

		unsigned int eip;
		unsigned int esp;
		unsigned int ebp;
		// The member must be placed at the tail of the class.
		unsigned char stack[];

	private:
		ExecuteBody() { }
} __attribute__((aligned(4096)));
}
#endif
